<!DOCTYPE html><html lang="zh-CN"><head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>feiertage | Moment.js &#x6587;&#x6863;</title>
  <link rel="stylesheet" href="static/css/style.css">
  <link rel="shortcut icon" href="http://momentjs.cn/static/img/moment-favicon.png">
  <link rel="stylesheet" href="static/css/atom-one-light.min.css">
</head>
<body class="is-moment">
  <div class="hero hero-oneline">
    <div class="hero-centered">
      <h1>feiertage</h1>
    </div>
  </div>
  <div id="api-section-__FILENAME__">
    <div id="content" class="clearfix">
  
      <div id="column1" data-id="__ID__" class="interior">
        <header>
          <!-- <h1>feiertage</h1> -->
          <div id="gtoc">
            <ul>
              <!-- <li>v</li> -->
              <li>
                <a href="index.html#/plugins/german-holiday/" name="toc">&#x8FD4;&#x56DE;&#x4E0A;&#x5C42;&#x6587;&#x6863;</a>
              </li>
              <li style="border: none;">
                <a href="javascript:window.open('https://github.com/momentjscn/moment-docs-cn/edit/master/moment/10-plugins/22-german-holiday.md');" rel="nofollow" target="_blank">&#x63D0;&#x4EA4;&#x4FEE;&#x6539;</a>
              </li>
              <!-- <li>
                <a href="/search__SEARCH_PARAM__" name="toc">搜索</a>
              </li> -->
            </ul>
          </div>
          <hr>
        </header>

        <div id="biz_item"></div>
  
        <div id="apicontent">
          <div id="content_left">
							<div class="docs-method-signature">
								<pre><code class="language-js">npm install moment-feiertage --save
</code></pre>

							</div>
<p>&#x8FD9;&#x4E2A; moment-feiertage &#x662F;&#x4E00;&#x4E2A; Moment.js &#x63D2;&#x4EF6;&#xFF0C;&#x7528;&#x4E8E;&#x786E;&#x5B9A;&#x65E5;&#x671F;&#x662F;&#x5426;&#x4E3A;&#x5FB7;&#x56FD;&#x5047;&#x671F;&#x3002;
&#x5047;&#x671F;&#x53D6;&#x81EA;&#x7EF4;&#x57FA;&#x767E;&#x79D1;&#xFF08;&#x5FB7;&#x56FD;&#xFF09;&#x3002;
&#x786E;&#x5B9A;&#x65E5;&#x671F;&#x662F;&#x5426;&#x4E3A;&#x5047;&#x65E5;&#x6709;&#x70B9;&#x590D;&#x6742;&#xFF0C;&#x56E0;&#x4E3A;&#x5B97;&#x6559;&#x8282;&#x65E5;&#x6BCF;&#x5E74;&#x53D8;&#x5316;&#xFF0C;&#x5728;&#x5FB7;&#x56FD;&#x7684; 16 &#x4E2A;&#x5DDE;&#x5185;&#x4E5F;&#x4E0D;&#x540C;&#x3002;</p>
<p>&#x7531; <a href="javascript:window.open('http://nodejs.cn/s/nHAT3H');" target="_blank" rel="nofollow">DaniSchenk</a> &#x521B;&#x5EFA;&#x3002;</p>
<pre><code class="language-js">var someDateInSomeStates = moment(&apos;2018-11-01&apos;).isHoliday([&apos;BW&apos;, &apos;SH&apos;, &apos;TH&apos;]);
/* returns {
  allStates: false,
  holidayName: &apos;Allerheiligen&apos;,
  holidayStates: [ &apos;BW&apos; ],
  testedStates: [ &apos;BW&apos;, &apos;SH&apos;, &apos;TH&apos; ]
}*/
</code></pre>
<p>&#x8BE5;&#x4ED3;&#x5E93;&#x4F4D;&#x4E8E; <a href="javascript:window.open('http://nodejs.cn/s/vQHce3');" target="_blank" rel="nofollow">github.com/DaniSchenk/moment-feiertage</a>&#x3002;</p>
					</div>
          <div id="content_right">
							<div class="docs-method-signature">
								<pre><code class="language-js">npm install moment-feiertage --save
</code></pre>

							</div>
<p>This (moment-feiertage) is a Moment.js plugin to determine if a date is a German holiday. Holidays are taken from Wikipedia (de). It&apos;s a bit complicated to determine if a date is a holiday, because religious holidays vary every year and differ within the 16 German states.</p>
<p>Made by <a href="javascript:window.open('https://github.com/DaniSchenk');" target="_blank" rel="nofollow">DaniSchenk</a>.</p>
<pre><code class="language-js">var someDateInSomeStates = moment(&apos;2018-11-01&apos;).isHoliday([&apos;BW&apos;, &apos;SH&apos;, &apos;TH&apos;]);
/* returns {
  allStates: false,
  holidayName: &apos;Allerheiligen&apos;,
  holidayStates: [ &apos;BW&apos; ],
  testedStates: [ &apos;BW&apos;, &apos;SH&apos;, &apos;TH&apos; ]
}*/
</code></pre>
<p>The repository is located at <a href="javascript:window.open('https://github.com/DaniSchenk/moment-feiertage');" target="_blank" rel="nofollow">github.com/DaniSchenk/moment-feiertage</a>.</p>
					</div>
          <div></div>
        </div>
      </div>
    </div>
  </div>
  
  <script src="static/js/highlight.min.js"></script>
  <script src="static/js/javascript.min.js"></script>
  <script>hljs.initHighlightingOnLoad();</script>
  <script>var _hmt = _hmt || []; (function () { var hm = document.createElement("script"); hm.src = "//hm.baidu.com/hm.js?7a7f78c805fbacc7e075d34f153031aa"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })();</script>

  <style>
    .hero-centered {
      margin: 0;
          margin-left: 10px;
    }
#gtoc ul {
  list-style: none;
  margin-left: 0;
  line-height: 1.5rem;
  padding: 0;
}
#gtoc>ul>li {
  display: inline;
  border-right: 1px solid #000;
  margin-right: .4rem;
  padding-right: .4rem;
}
#gtoc>ul>li>a {
  color: #61b2a7;
}
#content_left {
  width: 49%;float: left;border-right: 1px solid #eee;    padding-right: 2%;
}
#content_right {
float: left;width: 48%;margin-left: 3%;
}
#column1 {
  padding: 0 2rem;
}
  </style>


</body></html>